package com.ease.common.util;

import java.util.regex.Pattern;

import org.apache.commons.lang.StringUtils;

/**
 * 
 * @author nathanleewei
 * 
 */
public abstract class RegExpUtil extends Detect {

	public transient static final String HH24MI_REGEXP = "^([0]?[0-9]|1[0-9]|2[0-3]):{1}([0]?[0-9]|[1-5][0-9])$";

	public static boolean match(String str, String regex) {
		if (StringUtils.isEmpty(str) || StringUtils.isEmpty(regex))
			return false;
		Pattern pattern = Pattern.compile(regex);
		if (pattern.matcher(str).matches()) {
			return true;
		}
		return false;
	}

}
